﻿using DapperExtensions.Mapper;
using Newtonsoft.Json;

namespace ZilLion.Service.WeChatMall.Domain.Entitys.Orders
{
    public class DiscountGoodDetailEntity
    {
        /// <summary>
        ///     二级分类ID
        /// </summary>
        [JsonProperty("categoryId")]
        public long CategoryId { get; set; }

        /// <summary>
        ///     货品ID
        /// </summary>
        [JsonProperty("goodId")]
        public long GoodId { get; set; }

        /// <summary>
        ///     零售价格
        /// </summary>

        [JsonProperty("price")]
        public decimal Price { get; set; }

        /// <summary>
        ///     数量
        /// </summary>
        [JsonProperty("qty")]
        public decimal Qty { get; set; }
    }

    public class DiscountGoodDetailEntityMapper : ClassMapper<DiscountGoodDetailEntity>
    {
        public DiscountGoodDetailEntityMapper()
        {
            Table("#hp");
            Map(f => f.CategoryId).Column("ejflid");
            Map(f => f.GoodId).Column("hpid");
            Map(f => f.Price).Column("lsj");
            Map(f => f.Qty).Column("jmsl");
        }
    }
}